<template>
    <div>
      <x-header v-bind:left-options="{showBack:false}">
        <span>照片查看</span>
      </x-header>
     <div class="personal-top">
       <img src="@/assets/img/test_icon.jpg" class="personal-image"/>
       <div class="personal-top-info">
         <div>
           <span class="personal-name">{{userFullName}}</span>
           <span class="personal-job">{{userJob}}</span>
         </div>
         <p class="personal-part">{{userCompany}}</p>
         <p class="personal-part">{{userDept}}</p>
       </div>
     </div>
      <div class="personal-body">
        <ul>
          <li class="personal-info-item">
            <div>手机</div>
            <div class="personal-info-detail">{{userMobil}}</div>
          </li>
          <li class="personal-info-item" style="display: none">
            <div>固话</div>
            <div class="personal-info-detail">{{userTel}}</div>
          </li>
          <li class="personal-info-item">
            <div>邮箱</div>
            <div class="personal-info-detail">{{userEmail}}</div>
          </li>
        </ul>
      </div>
      <div class="personal-bottom" @click="logout">
       <span class="logout">退出登录</span>
      </div>
    </div>
</template>

<script>
  import {mapState} from 'vuex';
    export default {
      name: "photo",
      data(){
        var user = this.$store.state.user;
        return {
          userFullName: user.ADUSER_NAME,
          userJob: user.Forth_DeptName,
          userCompany: user.Third_DeptName,
          userDept: user.First_DeptName,
          userMobil: user.mobil,
          userTel: user.tel,
          userEmail: user.roleIDs
        }
      },
      methods:{
        logout:function(){
          const _this=this;
          this.$vux.confirm.show({
            content:'确认退出？',
            position:'middle',
            onConfirm(){
              // localStorage.clear();
              _this.$router.push('/');
            }
          })
        }
      }
    }
</script>

<style>
  .personal-top{
    display: flex;
    height: 120px;
    padding: 20px 15px;
    box-sizing: border-box;
    margin-bottom: 14px;
    background-color: #ffffff;
  }
  .personal-top-info{
    margin: 5px 0 0 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .personal-image{
    width: 80px;
    height: 80px;
    border-radius: 50%;
  }
  .personal-name{
    font-size: 18px;
    color: #343434;
    line-height: 18px;
  }
  .personal-job{
    display: inline-block;
    margin-left: 25px;
    font-size: 14px;
    color: #343434;
    line-height: 14px;
  }
  .personal-part{
    font-size: 14px;
    color: #9F9F9F;
    line-height: 14px;
  }
  .personal-body{
    padding: 17px 32px 17px 16px;
    box-sizing: border-box;
    background: #ffffff;
  }
  .personal-body>ul{
    position: relative;
  }

  .personal-body>ul>li{
    margin-top: 0;
    line-height: 14px;
    margin-bottom: 32px;
  }
  .personal-body>ul>li:last-child{
    margin-bottom: 0;
  }
  .personal-info-item{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
  }
  .personal-info-item:after{
    content: " ";
    width: calc(100% + 32px);
    height: 1px;
    border-top: 1px solid #F2F4F6;
    position: absolute;
    top: 31px;
    left: 0;
  }
  .personal-info-detail{
    color: #9F9F9F;
  }
  .personal-bottom{
    margin-top: 60px;
    text-align: center;
    height: 45px;
    background-color: #ffffff;
    padding-top: 10px;
    box-sizing: border-box;
  }
  .logout{
    font-size: 13px;
  }
</style>
